﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace Learn_MVC.Models
{
    public class Movie
    {
        public int ID { get; set; }

        [Display(Name ="电影名称")]
        public string Title { get; set; }

        [Display(Name = "上映时间")]
        [DataType(DataType.Date)]
        [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = true)]
        public DateTime ReleaseTime { get; set; }

        [Display(Name ="类型")]
        [Required]
        [MaxLength(20)]
        public string Genre { get; set; }

        [Display(Name ="票价")]
        public decimal Price { get; set; }

        [Display(Name ="描述")]
        [MaxLength(500)]
        public string Desc { get; set; }
    }
    public class MovieDBContext : DbContext
    {
        public DbSet<Movie> Movies { get; set; }
    }
}